package com.aiti.lulian.controller;

import com.aiti.base.core.utils.message.Message;
import com.aiti.lulian.annotates.LoginUser;
import com.aiti.lulian.bo.LoginUserInfo;
import com.aiti.lulian.dto.industry.CountyParkParamDto;
import com.aiti.lulian.dto.industry.CountyParkQueryDto;
import com.aiti.lulian.service.CardGovCountyParkService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @description: CountyParkController
 * @auth fcb
 * @date 2025-03-07 09:57
 **/
@RestController
@RequestMapping("/countyPark")
@Api(tags = "区县园区")
public class CountyParkController {

    @Autowired
    private CardGovCountyParkService cardGovCountyParkService;

    @ApiOperation(value = "新增区县园区")
    @PostMapping("/add")
    public Message addCountyPark(@RequestBody CountyParkParamDto paramDto, @LoginUser LoginUserInfo loginUserInfo) {
        cardGovCountyParkService.addCountyPark(paramDto, loginUserInfo);
        return Message.success();
    }

    @ApiOperation(value = "修改区县园区")
    @PostMapping("/update")
    public Message updateCountyPark(@RequestBody CountyParkParamDto paramDto, @LoginUser LoginUserInfo loginUserInfo) {
        cardGovCountyParkService.updateCountyPark(paramDto, loginUserInfo);
        return Message.success();
    }

    @ApiOperation(value = "删除区县园区")
    @PostMapping("/delete")
    public Message deleteCountyPark(@RequestBody List<String> baseIds) {
        cardGovCountyParkService.deleteCountyPark(baseIds);
        return Message.success();
    }

    @ApiOperation(value = "区县园区详情")
    @GetMapping("/detail")
    public Message getCountyParkDetail(@RequestParam("baseId") String baseId) {
        return Message.success(cardGovCountyParkService.getCountyParkDetail(baseId));
    }

    @ApiOperation(value = "区县园区列表")
    @PostMapping("/list")
    public Message getCountyParkList(@RequestBody CountyParkQueryDto paramDto) {
        return Message.success(cardGovCountyParkService.queryCountyParkList(paramDto));
    }
}
